package cn.xiuxius.embedded.command.converter;
import cn.xiuxius.embedded.model.StringFlashOptionType;
import picocli.CommandLine;

public class StringTypeConverter implements CommandLine.ITypeConverter<StringFlashOptionType> {
    @Override
    public StringFlashOptionType convert(String value) {
        try {
            return StringFlashOptionType.from(value.trim().toUpperCase());
        } catch (Exception e) {
            throw new CommandLine.TypeConversionException("Invalid boolean value: " + value);
        }
    }
}
